Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT EXPLORATION] chore(NA): upgrade to webpack 5 #191106

Draft
wants to merge 205 commits into
base: main
Choose a base branch
from

Conversation

mistic
Copy link
Member

@mistic mistic commented Aug 22, 2024

WIP

Summary

TODO

  • Upgrade dependencies to match the ones on webpack v5
  • Fix null-loader usages
  • Fix raw-loader usages
  • Fix file-loader usages
  • Fix url-loader usages
  • Fix @kbn/optimizer-webpack-helpers to support webpack v5
  • Adopt previous webpack v4 polyfill-all strategy with node-polyfill-webpack-plugin
  • Fix theme-loader on @kbn/optimizer
  • Migrate configurations and ad-hoc loader options on all webpack configs from v4 to v5
  • Fix @kbn/test jest resolver for file-loader cases
  • Migrate public-path loader on UiSharedDeps
  • Fix all usages of webpack-merge
  • Migrate BundleRemoteModule
  • Migrate BundleRemotesPlugin
  • Correctly migrate PopulateBundleCachePlugin
  • Correctly migrate BundleMetricsPlugin
  • Check if the profiling plugins still work (--profile flag)
  • Recover if possible the previous webpack v4 cacheGroup chunks rename to something like data.plugin.chunk.0.js
  • Run /ci and make sure we get our first green CI, otherwise work on the errors until we do
  • Profile and solve bottlenecks until we get a cold build performance similar to the one we had on webpack v4 (node scripts/build_kibana_platform_plugins --no-cache).
  • OpenSSL Legacy Warnings: try to remove --openssl-legacy-provider flags
  • Add Webpack to Renovate config
  • Explore removing NodePolyfillPlugin (here) and add each polyfill needed individually per each webpack config to check if we get smaller bundles. If we do it's better to go with the case by case need approach instead of deploying a bunch of polyfills with NodePolyfillPlugin. As another alternative, create a custom smaller plugin with only the union of all needed polyfills.
  • Evaluate if we want to touch the resolutions on mainFields and conditionNames
  • Understand why @import 'src/core/public/mixins' does not work anymore (not a problem, we should use relative paths anyway but we want to track why it changed from v4 to v5)
  • BUG: Child compilers are having errors hidden and/or changed from error to warning
  • Fix license check for Artistic-2.0 is the license for domain-browser. This package is a dependency of NodePolyfillPlugin. Artistic 2.0 license is classified as yellow and should only be used for dev dependencies.
  • Make sure resourceQuery: { not: /raw/ } is not necessary on other webpack configs like storybook one
  • Find what is being wrongly removed by usedExports optimization; hint: I believe it is identifying a lot of exports inside the sync entry of plugins as unused exports and removing them. Then __kbnBootstrap__ can't be found
  • Rebalance @kbn/optimizer pickMaxWorkerCount
  • Re-open the issue to fix sass-warnings #190345 or downgrade sass-loader to v10
  • Remove previous esm no parse rules
  • Confirm esm support is working
  • Confirm console override is needed
  • Confirm react prod builds on ui shared deps for distributable
  • Remove customization for xyflow from webpack configs
  • Clean all the code
  • Make sure collected metrics from stats are still aligned with what we were collecting before; also verify if the modules used for optimizer caches etc are well generated (@kbn/node-libs-browser)
  • Fix watch performance

@elastic elastic deleted a comment from kibana-ci Aug 22, 2024
@Ikuni17 Ikuni17 mentioned this pull request Aug 23, 2024
2 tasks
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
## Summary

Upgrades references to webpack5 from v5.91.0 to v5.96.1

A v4 to v5 upgrade is being explored here:
elastic#191106

---------

Co-authored-by: kibanamachine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
## Summary

Combine some Renovate groups.

Disable TS group. Closes elastic#189415.
Disable Webpack group until elastic#191106 is finished.
@elastic elastic deleted a comment from elasticmachine Dec 17, 2024
@mistic mistic force-pushed the upgrade-to-webpack-5 branch from d529c35 to 09ac9af Compare December 29, 2024 04:40
@elastic elastic deleted a comment from elasticmachine Dec 29, 2024
@elastic elastic deleted a comment from elasticmachine Jan 3, 2025
@elastic elastic deleted a comment from elasticmachine Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release chore ci:build-webpack-bundle-analyzer release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Webpack to v5
3 participants